import request from '@/config/axios'

// 树洞AI聊天会话 VO
export interface UserTreeHoleChatRecordVO {
  id: number // 主键
  userId: number // 用户编号
  title: string // 会话标题
}

// 树洞AI聊天会话 API
export const UserTreeHoleChatRecordApi = {
  // 查询树洞AI聊天会话分页
  getUserTreeHoleChatRecordPage: async (params: any) => {
    return await request.get({ url: `/business/user-tree-hole-chat-record/page`, params })
  },

  // 查询树洞AI聊天会话详情
  getUserTreeHoleChatRecord: async (id: number) => {
    return await request.get({ url: `/business/user-tree-hole-chat-record/get?id=` + id })
  },

  // 新增树洞AI聊天会话
  createUserTreeHoleChatRecord: async (data: UserTreeHoleChatRecordVO) => {
    return await request.post({ url: `/business/user-tree-hole-chat-record/create`, data })
  },

  // 修改树洞AI聊天会话
  updateUserTreeHoleChatRecord: async (data: UserTreeHoleChatRecordVO) => {
    return await request.put({ url: `/business/user-tree-hole-chat-record/update`, data })
  },

  // 删除树洞AI聊天会话
  deleteUserTreeHoleChatRecord: async (id: number) => {
    return await request.delete({ url: `/business/user-tree-hole-chat-record/delete?id=` + id })
  },

  // 导出树洞AI聊天会话 Excel
  exportUserTreeHoleChatRecord: async (params) => {
    return await request.download({ url: `/business/user-tree-hole-chat-record/export-excel`, params })
  },

// ==================== 子表（树洞AI聊天消息） ====================

  // 获得树洞AI聊天消息分页
  getUserTreeHoleChatPage: async (params) => {
    return await request.get({ url: `/business/user-tree-hole-chat-record/user-tree-hole-chat/page`, params })
  },
  // 新增树洞AI聊天消息
  createUserTreeHoleChat: async (data) => {
    return await request.post({ url: `/business/user-tree-hole-chat-record/user-tree-hole-chat/create`, data })
  },

  // 修改树洞AI聊天消息
  updateUserTreeHoleChat: async (data) => {
    return await request.put({ url: `/business/user-tree-hole-chat-record/user-tree-hole-chat/update`, data })
  },

  // 删除树洞AI聊天消息
  deleteUserTreeHoleChat: async (id: number) => {
    return await request.delete({ url: `/business/user-tree-hole-chat-record/user-tree-hole-chat/delete?id=` + id })
  },

  // 获得树洞AI聊天消息
  getUserTreeHoleChat: async (id: number) => {
    return await request.get({ url: `/business/user-tree-hole-chat-record/user-tree-hole-chat/get?id=` + id })
  },
}